package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dao.EmployeePageQueryDTO;
import com.sky.entity.Employee;

import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmployeeMapper {
    @Select("select  * from employee where username = #{username}")
    Employee getByUsername(String username);


    /**
     * 分页查询员工信息
     *
     * @param employeePageQueryDTO
     * @return
     */
    Page<Employee> page(EmployeePageQueryDTO employeePageQueryDTO);

    @AutoFill(OperationType.INSERT)
    void save(Employee employee);

    @Select("select * from employee where id = #{id}")
    Employee getById(Long id);

    @AutoFill(value=OperationType.UPDATE)
    void update(Employee employee);
}
